UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MmmdvQSTZjfKuoMYt/xIb6itzyt6WVRzVhDPUWGK82k='
WHERE
key_id = 'c85cdc745bca654638ab3b0e5649f06c99a4a341c7b4da641e64b86369f3279d'
AND (
token = 'MmmdvQSTZjfKuoMYt/xIb6itzyt6WVRzVhDPUWGK82k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)