UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Y+ln7Vr05ZjV29QZaeMhEtl8IgBGxmASIkeoc3i4xg=' 
WHERE 
  key_id = '751112c92a23716f30399ad4063287e473dd4ebd2979723c2d27c5a4f7d5cce8' 
  AND (
    token = '1Y+ln7Vr05ZjV29QZaeMhEtl8IgBGxmASIkeoc3i4xg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029