UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V4ad2cdns3nsHu/lJWHhLU4vQTUGu4oGbUXxw7iZFlg=' 
WHERE 
  key_id = '3f030f9c666e0268e304aac9e4031182afe41cd4aa135924cf77a5a929ed192a' 
  AND (
    token = 'V4ad2cdns3nsHu/lJWHhLU4vQTUGu4oGbUXxw7iZFlg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00397