UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wCImf0wImrEi59i+cLADGTTgTQ1Ya9Geyk2VLcey75E='
WHERE
key_id = '218d20b489de1042a86bd3c3b659da0148779e5fcfe7dcb489effa1bf0fb42dd'
AND (
token = 'wCImf0wImrEi59i+cLADGTTgTQ1Ya9Geyk2VLcey75E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)