UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZSjdqp/SaIG4XahrU9d8/Y14VscrankIlrTM51dEhz4='
WHERE
key_id = 'cf52566064ceb6442d6bab41efe8c0eea4b3e5734f2566f4d2ff100cb8825eb3'
AND (
token = 'ZSjdqp/SaIG4XahrU9d8/Y14VscrankIlrTM51dEhz4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)