UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QC/uo0VJraY0uB6pAVKIR57m0RrwF3AjkXEwipVklwU='
WHERE
key_id = 'e5fbfbf2c2ccc1ca29ba340e0e7cdf46cc5b683f7c789f689631cfa5abe5c0e9'
AND (
token = 'QC/uo0VJraY0uB6pAVKIR57m0RrwF3AjkXEwipVklwU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)