UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QXsbEW0bc0ER1nWS0gPu2WEKfZKub2r5EpDJV48c2s0='
WHERE
key_id = '884d084603b3ee229af7839efa1eb4f364251ee3cb8005f766171d8fb5e06dfc'
AND (
token = 'QXsbEW0bc0ER1nWS0gPu2WEKfZKub2r5EpDJV48c2s0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)