UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GxxqA4hKPhMCQuXjbb6iLB/oO5u3WCeiYZ/MlkE8nxI='
WHERE
key_id = 'af794462467a70c63336ccb95a7607bf7bb1fe9d35329ac4fcd4b2276457ec2b'
AND (
token = 'GxxqA4hKPhMCQuXjbb6iLB/oO5u3WCeiYZ/MlkE8nxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)