UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YvRPMsZLzlK0o84Bf7+y3F2Oqzj0zRPvj2xS8m1mz1I=' 
WHERE 
  key_id = '35ca8664c5ea3cbd3961d5fc6d7d8b7b69cbbdd69f2f83fbeec4cbb7afefd2e2' 
  AND (
    token = 'YvRPMsZLzlK0o84Bf7+y3F2Oqzj0zRPvj2xS8m1mz1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058