UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8eV/dSjBxcGrx0ax7f0DtfU//6Bv8WOsrnEDuLQvWIw=' 
WHERE 
  key_id = 'f9784c7111a3ebe79cbe39da176940cecaba3f990c6914e1d132e11f41cd4f4a' 
  AND (
    token = '8eV/dSjBxcGrx0ax7f0DtfU//6Bv8WOsrnEDuLQvWIw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030