UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K3IQmvYh1/2RA6YshXmH5p4CykxWq3GF9lls1OODyuE='
WHERE
key_id = '4bb8518040d83817d4115bff1c93ffbc4607b1251ccb8e54155b2fa9f6fdf03a'
AND (
token = 'K3IQmvYh1/2RA6YshXmH5p4CykxWq3GF9lls1OODyuE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)