UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n3N9IXWeK3U/kwpDVq7aniuutPw9we6cBprMwaB4E7Q='
WHERE
key_id = 'fd5725379d42a09eba5ec36cb0ecd37ed7b5a9dac9ca1d716492a9ed91fe4556'
AND (
token = 'n3N9IXWeK3U/kwpDVq7aniuutPw9we6cBprMwaB4E7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)