UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dUkWNUvw4/0q6AtoI7VVuWTZjRHWK6TY6swx9KC5zqs='
WHERE
key_id = 'e59e6335ad4fbad4fa48e9daecdc1cbb5d53dea63e7af734fb15f42fe19387c6'
AND (
token = 'dUkWNUvw4/0q6AtoI7VVuWTZjRHWK6TY6swx9KC5zqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)