UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VFIr3Re+tTuqvjnQEx/2M6FXBBUjEdSFRuMDtqZXIL8='
WHERE
key_id = 'ddeebbea15439e1c79051a2d46d5083bfcb56707e3aa8c245e027a39c5dc2997'
AND (
token = 'VFIr3Re+tTuqvjnQEx/2M6FXBBUjEdSFRuMDtqZXIL8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)