UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qv3I3kjptc9FBiD+cs2EADENC8UbPA8iB9w7/CIK0M4='
WHERE
key_id = '3bb7f7cb47272517fc6e0811ffb2b1a0c445b518c1d7da79413f2a6733c37059'
AND (
token = 'Qv3I3kjptc9FBiD+cs2EADENC8UbPA8iB9w7/CIK0M4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)