UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FxMm7OOJ8SAFHos9pr3zTYIWlQZ5lKbgmteVT4AsMxk='
WHERE
key_id = '57e18c0d7909a393db244609f667f8edeca7ff9db497c34d5b15c329b63d8e0e'
AND (
token = 'FxMm7OOJ8SAFHos9pr3zTYIWlQZ5lKbgmteVT4AsMxk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)