UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EoX+ZfzTnjJG7EB5aenJpWUmhzadO+6dd4EwOSOoNnA='
WHERE
key_id = '87e1e6e92dc753e60429492127159f9bab5b24f88b3d81222a97d0ef1961def8'
AND (
token = 'EoX+ZfzTnjJG7EB5aenJpWUmhzadO+6dd4EwOSOoNnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)