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

Query time 0.00023