UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yS/Sj86KEyAIwHJ1YnyrxOzUiXh3eqbPm1qpn6zNVoA=' 
WHERE 
  key_id = '7b8343db60581c2bf3ddd35467a954a5a816d775d2ac02e095c2433bc1264c2a' 
  AND (
    token = 'yS/Sj86KEyAIwHJ1YnyrxOzUiXh3eqbPm1qpn6zNVoA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033