UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4UONxYEGLIOktqdEmDa+LlMLl9+9FFvZa2PYKS44ziI=' 
WHERE 
  key_id = '423a0a88702507d3c16993855fecfad2e5151e4caed5cdfcd961352e7d7127aa' 
  AND (
    token = '4UONxYEGLIOktqdEmDa+LlMLl9+9FFvZa2PYKS44ziI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00167