UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lenzgXZN3AZ5WFwKlrTyOyHrpNoQlwa96A4bHenRVXs=' 
WHERE 
  key_id = '9335ad603fd74674fc1b849b211a2db4fe5905eb0a60ceb403dd64a9b5a8dc9d' 
  AND (
    token = 'lenzgXZN3AZ5WFwKlrTyOyHrpNoQlwa96A4bHenRVXs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019