UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f+nxf8iDMEnFYHxgVHc3N8MZwx6kf7vnstXw6psA7hw='
WHERE
key_id = '08b418b842d4ab0d2d1f5930afe05af4d2d53eb786338e1674476fc0c4271d83'
AND (
token = 'f+nxf8iDMEnFYHxgVHc3N8MZwx6kf7vnstXw6psA7hw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)