UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zoXkLKWllbkViynm9ExZOdblAdx9x3lksXAksXCo4no=' 
WHERE 
  key_id = 'fee2e72254e48188f2de74755c276df67c1dc11d38542caf68c5f1fafe28602f' 
  AND (
    token = 'zoXkLKWllbkViynm9ExZOdblAdx9x3lksXAksXCo4no=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036