UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OhsOGygiWBhKZAQLo3pGkZjMU9kC5gp6AiXfDjSv788=' 
WHERE 
  key_id = '1c101e83dc3e34e7b3bf972b76e69d9d008eef13f4d339dd578f306ea0fb8420' 
  AND (
    token = 'OhsOGygiWBhKZAQLo3pGkZjMU9kC5gp6AiXfDjSv788=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017