UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/hYnJ8ZSCdqOKi9+nFLiYce3e6V8/y8QKiv3Yq1WYCw='
WHERE
key_id = 'c452987be1151c18d7068c3c83b3bbff9abfa47c2744667e9bcfe33c327439e5'
AND (
token = '/hYnJ8ZSCdqOKi9+nFLiYce3e6V8/y8QKiv3Yq1WYCw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)