UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FyLMwWAdLvoM8IPNXkzU+9KXJVl6JADJpwYDvkg+cEk='
WHERE
key_id = 'b0ae20dfab493444f2502842f226c7f8558acf95264fab401192829e29fcbbd3'
AND (
token = 'FyLMwWAdLvoM8IPNXkzU+9KXJVl6JADJpwYDvkg+cEk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)