UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zz5PVZgnbPM60fIqksNF3C7gBqFRR3TUsJEpdksfSVw='
WHERE
key_id = '84f02846045e0b5268b4e0aa8738bea7973c407555258cea79ef895d2d1d39ee'
AND (
token = 'zz5PVZgnbPM60fIqksNF3C7gBqFRR3TUsJEpdksfSVw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)