UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EMSXcZtncwEEvJvY4iYc73rHg7XgA4Rg/COaIaZ/o2M=' 
WHERE 
  key_id = 'e2e8af4c15b7e084f0cbb4c71e5aadc3bab103bd442a605c9a7486ded47ca3fc' 
  AND (
    token = 'EMSXcZtncwEEvJvY4iYc73rHg7XgA4Rg/COaIaZ/o2M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023