UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1qwOTYZ7MpkkPFID6J6cG2Uz3wZSqNPlXkrtKpeTkrg='
WHERE
key_id = 'e76dc7eda4656c8bb4a758dd5ca16ce3bd9bda48468339b8bd54c620325b071a'
AND (
token = '1qwOTYZ7MpkkPFID6J6cG2Uz3wZSqNPlXkrtKpeTkrg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)