UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4j7eWGqp3gwPEc0JbHgZ5kKmxhp6MCkQBDo+gKCpHmw=' 
WHERE 
  key_id = 'c950f0a8c5b2f90b19bbe180f2a85e0e24c076428c341e06d4900a79e3f2d40b' 
  AND (
    token = '4j7eWGqp3gwPEc0JbHgZ5kKmxhp6MCkQBDo+gKCpHmw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029