UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VdsvcBXvCzTOJas3BXiMeqyJx8gbh5Zes9zsAVqIanM='
WHERE
key_id = 'f1ab91045676bd82af3ee03f6652c7fcdaa4d32db35c70575c31447e082e584e'
AND (
token = 'VdsvcBXvCzTOJas3BXiMeqyJx8gbh5Zes9zsAVqIanM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)