UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'schzOG+9jBc2duiyihgIwaDx8Rm2q+5swXaR0gkt+mE=' 
WHERE 
  key_id = '4b5968546e5f917fd377c1dd0589f653ac01f7cd88938c677827eea9f04c3504' 
  AND (
    token = 'schzOG+9jBc2duiyihgIwaDx8Rm2q+5swXaR0gkt+mE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040