UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9vSl7VmSBjFVkFSqsgaHxQzUO7zfXazMJiizsRC/wLg='
WHERE
key_id = '49fffc906a415353fc924d3488b858836d02270f96600bec94e5e23a94df3287'
AND (
token = '9vSl7VmSBjFVkFSqsgaHxQzUO7zfXazMJiizsRC/wLg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)