UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W359b3EVN3N04KrKm/rBomdTcDDfI5fjl/St9LuvOhU='
WHERE
key_id = '84f3fd7c8e38ce3b26fd3763b4c7d430fc223884c181dcfdb1dbd505b9763b65'
AND (
token = 'W359b3EVN3N04KrKm/rBomdTcDDfI5fjl/St9LuvOhU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)